def get_mstoken():
    import requests

    headers = {
        'accept': '*/*',
        'accept-language': 'zh-CN,zh;q=0.9',
        'cache-control': 'no-cache',
        'content-type': 'text/plain;charset=UTF-8',
        'origin': 'https://www.douyin.com',
        'pragma': 'no-cache',
        'priority': 'u=1, i',
        'referer': 'https://www.douyin.com/',
        'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
        'sec-ch-ua-mobile': '?0',
        'sec-ch-ua-platform': '"macOS"',
        'sec-fetch-dest': 'empty',
        'sec-fetch-mode': 'cors',
        'sec-fetch-site': 'cross-site',
        'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
    }

    params = {
        'ms_appid': '6383',
    }

    data = '{"magic":538969122,"version":1,"dataType":8,"strData":"fIpDBMaze2OvRYDGojiuVka/WukIO6JYbqcxjhvWSbdy3eV7i9yqIegMqbgwrDfx492Hh1UY+r8vIQ2FEvhFI2ViJhn0/TzPPoDdvqHLc/AL7h3DZpMYFmvqEOt9gg4JVCZ17eJ4AmEtMjdI54y/VwQnuS0qXCavvcNYdtDcA+WGP4fm4YUBVRB4lnFezx+s+VJae2nWfKZbo1KZW1+qHZUxzzWq6ETfCwHQUji9ZdZaNmmYFF4N7B/7+J0GGoEVESuQGm8VG401clz4NYmDkm2Z0zgAQrL3rqgfW0yDWi9eJfi84NHDZqMgIEt0NLy0hrjJtEKqzPC7GBthM6d6n020XORL9c2duhk/lFqG175Rxk75eaqjR9twIFTXWttQMi5WK5ChlL4vDOIlWYf4crsH7KYI5N4mel5vASBLxoOHbKsJGWQNWkRqe/NDr+bJ4DGZxpb+k0zsds3tgtsZ7gqfypIEznTMQYyQubKe/lnICRxw/GtrVuMCVAo7ySED1cAbIs/+akHvxzIiOIb4uryplvi64/XZEemonnKxqqlzx4Gb10Yd49VMhL8LbMIrfUlF5wr4umND8gYkxUQZM29FaVUF2GES5UrfHL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mV+L3ieNONahrZ/CPFlowi/F1HFjIAH7r1dWVUi2xmgk7veRi9gfF1nhd78GRkiZmnv9Ng2AUMVEvKJS/Fq1ovlBZgpojFPDZwuvjCUvr9RmX4siyZJxkqDp7OQVXTrjBi01pfpuYIvhtDp9yvPyfwc0urAlqqCmMlKYofnBpdK2nPwEspwJjem4diAj6SCNRrlzVzE2SNdoBHeBs9ceZsHqnvu1t/PJBoAwDVNQSWpIO69avHXqR48Fan6oV9JQJ2u4fahfOUIVER7xERXwqjA0y3phRtmaDPHAiYsLcQaPTICkAPx/+9fbOfmqXopyH+mpwV7W/f1xs6aHf2SKbC+D=","tspFromClient":1750254423583,"ulr":0}'

    response = requests.post('https://mssdk.bytedance.com/web/r/token', params=params, headers=headers, data=data)
    # print(response.cookies.get_dict()['msToken'])
    return response.cookies.get_dict()['msToken']